export default {
	download: function (url, data) {
		let form = document.getElementById('__tempForm__');

		if (form) {
			form.remove();
		}

		form = document.createElement('form');

		form.id = '__tempForm__';
		form.method = 'post';
		form.action = url;

		let hf = document.createElement('input');

		hf.type = 'hidden';
		hf.name = '__jsonValue__';
		hf.value = JSON.stringify(data);

		form.appendChild(hf);

		document.body.appendChild(form);

		form.submit();
	}
}